/*
 * StationaryWashingDevice.h
 *
 *  Created on: Sep 27, 2012
 *      Author: root
 */

#ifndef STATIONARYWASHINGDEVICE_H_
#define STATIONARYWASHINGDEVICE_H_

#include "HardwareAbstractionInteractionProtocolLayer.h"
class HardwareAbstractionInteractionProtocolLayer;
#include "AtomicAtomShakingDeviceController.h"
#include "CircularRotationDeviceController.h"
#include "HeavyDutySuperCollidingSuperButtonDeviceController.h"
#include "HydrofobicAntiStainDeviceController.h"
#include "LiquidDistributionChannelingDeviceController.h"
#include "MonetaryValuedCircularMetalObjectDeviceController.h"
#include "UserInteractionGateDeviceController.h"
#include "WashingProgram.h"

#include "IEventListener.h"

//template <class C> void (C::*ControlledFunction)()
//{
//	bool enabled;
//} ControlledFunction;
//



class StationaryWashingDevice 
{
public:
	StationaryWashingDevice();
	void run();
	HardwareAbstractionInteractionProtocolLayer *HAL;

	bool onStartPressed();
	void onSelectProgram();

private:
	AtomicAtomShakingDeviceController *heater;
	CircularRotationDeviceController *motor;
	HeavyDutySuperCollidingSuperButtonDeviceController *buttons;
	HydrofobicAntiStainDeviceController *soap;
	LiquidDistributionChannelingDeviceController *water;
	MonetaryValuedCircularMetalObjectDeviceController *money;
	UserInteractionGateDeviceController *door;
	void executeSteps(Program *program);
	WashingProgram *programs[3];

	int selectedProgram;
	bool start;

	bool onStartPressedHandlerEnabled;
	bool onSelectProgramHandlerEnabled;

	//EventHandler* onStartPressedHandler;
	//EventHandler* onProgramSelectHandler;
};

#endif /* STATIONARYWASHINGDEVICE_H_ */
